#include <stdio.h>
int main()
{
	int i;
	int judge_num = 0;
	int sum = 0;
	int num = 1;
	char judge;
	char ISBN[14] = {0};
	for(i = 0;i < 13;i++)
	{
		scanf("%c",&ISBN[i]);
	}
	for(i = 0;i < 11;i++)//别把最后的数字也加进去
	{
		if(ISBN[i] !='-')
		{
			sum +=( (ISBN[i]-'0')*(num++));//数字变字符，字符变数字
		}
	}
	judge_num = sum % 11;
	judge  = judge_num +'0';
	if(judge_num == 10)//忘记考虑
	{
		judge = 'X';
	}
	if(ISBN[12] == judge)
	{
		printf("Right");
	}
	else
	{
		ISBN[12] = judge;
	    for(i = 0;ISBN[i]!= '\0';i++)
	   {
	    	printf("%c",ISBN[i]);
	   }
    }    
	return 0;
}